home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / AppleScript / Development Tools / Interfaces / AppleScript 1.0 Interfaces / PInterfaces / OSA.p < prev   
Encoding:
Text File  |  1993-04-08  |  19.8 KB  |  649 lines  |  [TEXT/MPS ]

  1. {
  2. ////////////////////////////////////////////////////////////////////////////////
  3. // OPEN SCRIPTING ARCHITECTURE: Client Interface
  4. ////////////////////////////////////////////////////////////////////////////////
  5. // Copyright © 1992 Apple Computer, Inc. All rights reserved.
  6. // Authors: Jens Alfke, William Cook, Donn Denman, and Warren Harris
  7. ////////////////////////////////////////////////////////////////////////////////
  8. // This interface defines what it means to be a "scripting component."
  9. // Scripting components allow "scripts" to be loaded and executed.  This
  10. // interface does not define the way in which a particular scripting
  11. // component's scripts are editing and debugged.
  12. ////////////////////////////////////////////////////////////////////////////////
  13. }
  14.  
  15. {$IFC UNDEFINED UsingIncludes}
  16. {$SETC UsingIncludes := 0}
  17. {$ENDC}
  18.  
  19. {$IFC NOT UsingIncludes}
  20.     UNIT OSA;
  21.     INTERFACE
  22. {$ENDC}
  23.  
  24. {$IFC UNDEFINED UsingOSA}
  25. {$SETC UsingOSA := 1}
  26.  
  27. {$I+}
  28. {$SETC OSAIncludes := UsingIncludes}
  29. {$SETC UsingIncludes := 1}
  30. {$IFC UNDEFINED UsingAppleEvents}
  31. {$I $$Shell(PInterfaces)AppleEvents.p}
  32. {$ENDC}
  33. {$IFC UNDEFINED UsingAEObjects}
  34. {$I $$Shell(PInterfaces)AEObjects.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED UsingComponents}
  37. {$I $$Shell(PInterfaces)Components.p}
  38. {$ENDC}
  39. {$SETC UsingIncludes := OSAIncludes}
  40.  
  41. { Types and Constants }
  42. CONST
  43.     kOSAComponentType                            = 'osa ';
  44.     kOSAGenericScriptingComponentSubtype        = 'scpt';
  45.  
  46.     kOSAFileType                                = 'osas';
  47.     { Type of script document files. }
  48.  
  49. TYPE
  50.     OSAID                            = LONGINT;
  51.     OSAError                        = ComponentResult;
  52.  
  53. CONST
  54.     kOSANullScript                    = 0;
  55.     kOSANullMode                    = 0;
  56.     kOSAModeNull                    = 0;
  57.     
  58.     kOSASuite                        = 'ascr';
  59.     kOSARecordedText                = 'recd';
  60.     
  61.     kOSAScriptResourceType            = kOSAGenericScriptingComponentSubtype;
  62.     typeOSAGenericStorage            = kOSAScriptResourceType;
  63.  
  64. { Error Codes }
  65.     
  66.     { API Errors }
  67.     errOSASystemError                = -1750;
  68.     errOSAInvalidID                    = -1751;
  69.     errOSABadStorageType            = -1752;
  70.     errOSAScriptError                = -1753;
  71.     errOSABadSelector                = -1754;
  72.     errOSASourceNotAvailable        = -1756;
  73.     errOSANoSuchDialect                = -1757;
  74.     errOSADataFormatObsolete        = -1758;
  75.     errOSADataFormatTooNew            = -1759;
  76.     errOSACorruptData                = errAECorruptData;
  77.     errOSARecordingIsAlreadyOn        = errAERecordingIsAlreadyOn;
  78.  
  79.     { Dynamic errors }
  80.     errOSACantCoerce                = errAECoercionFail;
  81.     errOSACantAccess                = errAENoSuchObject;
  82.     errOSACantAssign                = -10006;
  83.     errOSAGeneralError                = -2700;
  84.     errOSADivideByZero                = -2701;
  85.     errOSANumericOverflow            = -2702;
  86.     errOSACantLaunch                = -2703;
  87.     errOSAAppNotHighLevelEventAware    = -2704;
  88.     errOSACorruptTerminology        = -2705;
  89.     errOSAStackOverflow                = -2706;
  90.     errOSAInternalTableOverflow        = -2707;
  91.     errOSADataBlockTooLarge            = -2708;
  92.     
  93.     { Component-specific dynamic script errors: -2720 thru -2739 } 
  94.  
  95.     { Static errors }
  96.     errOSATypeError                    = errAEWrongDataType;
  97.     errOSAMessageNotUnderstood        = errAEEventNotHandled;
  98.     errOSAUndefinedHandler            = errAEHandlerNotFound;
  99.     errOSAIllegalAccess                = errAEAccessorNotFound;
  100.     errOSAIllegalIndex                = errAEIllegalIndex;
  101.     errOSAIllegalRange                = errAEImpossibleRange;
  102.     errOSAIllegalAssign                = -10003;
  103.     errOSASyntaxError                = -2740;
  104.     errOSASyntaxTypeError            = -2741;
  105.     errOSATokenTooLong                = -2742;
  106.     errOSAMissingParameter            = errAEDescNotFound;
  107.     errOSAParameterMismatch            = errAEWrongNumberArgs;
  108.     errOSADuplicateParameter        = -2750;
  109.     errOSADuplicateProperty            = -2751;
  110.     errOSADuplicateHandler            = -2752;
  111.     errOSAUndefinedVariable            = -2753;
  112.     errOSAInconsistentDeclarations    = -2754;
  113.     errOSAControlFlowError            = -2755;
  114.  
  115.     { Component-specific static script errors: -2760 thru -2779 }
  116.  
  117.     { Dialect-specific script errors: -2780 thru -2799 }
  118.  
  119. {
  120. ////////////////////////////////////////////////////////////////////////////////
  121. // OSA Interface Descriptions
  122. ////////////////////////////////////////////////////////////////////////////////
  123. // The OSA Interface is broken down into a required interface, and several
  124. // optional interfaces to support additional functionality.  A given scripting
  125. // component may choose to support only some of the optional interfaces in
  126. // addition to the basic interface.  The OSA Component Flags may be used to 
  127. // query the Component Manager to find a scripting component with a particular
  128. // capability, or determine if a particular scripting component supports a 
  129. // particular capability.
  130. ////////////////////////////////////////////////////////////////////////////////
  131. }
  132.     
  133.     { OSA Component Flags }
  134.     kOSASupportsCompiling                = $0002;
  135.     kOSASupportsGetSource                = $0004;
  136.     kOSASupportsAECoercion                = $0008;
  137.     kOSASupportsAESending                = $0010;
  138.     kOSASupportsRecording                = $0020;
  139.     kOSASupportsConvenience                = $0040;
  140.     kOSASupportsDialects                = $0080;
  141.     kOSASupportsEventHandling            = $0100;
  142.     
  143.     { Component Selectors }
  144.     { Basic Scripting: }
  145.     kOSASelectLoad                        = $0001;
  146.     kOSASelectStore                        = $0002;
  147.     kOSASelectExecute                    = $0003;
  148.     kOSASelectDisplay                    = $0004;
  149.     kOSASelectScriptError                = $0005;
  150.     kOSASelectDispose                    = $0006;
  151.     kOSASelectSetScriptInfo                = $0007;
  152.     kOSASelectGetScriptInfo                = $0008;
  153.     kOSASelectSetActiveProc                = $0009;
  154.     kOSASelectGetActiveProc                = $000A;
  155.     { Compiling: }
  156.     kOSASelectScriptingComponentName    = $0102;
  157.     kOSASelectCompile                    = $0103;
  158.     kOSASelectCopyID                    = $0104;
  159.     { GetSource: }
  160.     kOSASelectGetSource                    = $0201;
  161.     { AECoercion: }
  162.     kOSASelectCoerceFromDesc            = $0301;
  163.     kOSASelectCoerceToDesc                = $0302;
  164.     { AESending: }
  165.     kOSASelectSetSendProc                = $0401;
  166.     kOSASelectGetSendProc                = $0402;
  167.     kOSASelectSetCreateProc                = $0403;
  168.     kOSASelectGetCreateProc                = $0404;
  169.     kOSASelectSetDefaultTarget            = $0405;
  170.     { Recording: }
  171.     kOSASelectStartRecording            = $0501;
  172.     kOSASelectStopRecording                = $0502;
  173.     { Convenience: }
  174.     kOSASelectLoadExecute                = $0601;
  175.     kOSASelectCompileExecute            = $0602;
  176.     kOSASelectDoScript                    = $0603;
  177.     { Dialects: }
  178.     kOSASelectSetCurrentDialect            = $0701;
  179.     kOSASelectGetCurrentDialect            = $0702;
  180.     kOSASelectAvailableDialects            = $0703;
  181.     kOSASelectGetDialectInfo            = $0704;
  182.     kOSASelectAvailableDialectCodeList    = $0705;
  183.     { Event Handling: }
  184.     kOSASelectSetResumeDispatchProc        = $0801;
  185.     kOSASelectGetResumeDispatchProc        = $0802;
  186.     kOSASelectExecuteEvent                = $0803;
  187.     kOSASelectDoEvent                    = $0804;
  188.     kOSASelectMakeContext                = $0805;
  189.  
  190.     kOSASelectComponentSpecificStart    = $1001;
  191.     { scripting component specific selectors are added beginning with this 
  192.       value }
  193.     
  194.     { Mode Flags }
  195.     kOSAModePreventGetSource            = $00000001;
  196.     kOSAModeNeverInteract                = kAENeverInteract;
  197.     kOSAModeCanInteract                    = kAECanInteract;
  198.     kOSAModeAlwaysInteract                = kAEAlwaysInteract;
  199.     kOSAModeDontReconnect                = kAEDontReconnect;
  200.     kOSAModeCantSwitchLayer                = $00000040;
  201.     kOSAModeDoRecord                    = $00001000;
  202.     kOSAModeCompileIntoContext            = $00000002;
  203.     kOSAModeAugmentContext                = $00000004;
  204.     kOSAModeDisplayForHumans            = $00000008;
  205.     kOSAModeDontStoreParent                = $00004000;
  206.  
  207. {
  208. ////////////////////////////////////////////////////////////////////////////////
  209. // OSA Basic Scripting Interface
  210. ////////////////////////////////////////////////////////////////////////////////
  211. // Scripting components must at least support the Basic Scripting interface.
  212. ////////////////////////////////////////////////////////////////////////////////
  213. }
  214.  
  215. { Loading and Storing Scripts }
  216.  
  217. FUNCTION
  218. OSALoad(scriptingComponent        : ComponentInstance;
  219.         scriptData                : AEDesc;
  220.         modeFlags                : LONGINT;
  221.         VAR resultingScriptID    : OSAID)
  222.     : OSAError;
  223.     INLINE $2F3C, $000C, $0001, $7000, $A82A;
  224.  
  225. FUNCTION
  226. OSAStore(scriptingComponent            : ComponentInstance; 
  227.          scriptID                    : OSAID; 
  228.          desiredType                : DescType;
  229.          modeFlags                    : LONGINT;
  230.          VAR resultingScriptData    : AEDesc)
  231.     : OSAError;
  232.     INLINE $2F3C, $0010, $0002, $7000, $A82A;
  233.  
  234. { Executing Scripts }
  235.  
  236. FUNCTION
  237. OSAExecute(scriptingComponent            : ComponentInstance;
  238.            compiledScriptID                : OSAID;
  239.            contextID                    : OSAID;
  240.            modeFlags                    : LONGINT;
  241.            VAR resultingScriptValueID    : OSAID)
  242.     : OSAError;
  243.     INLINE $2F3C, $0010, $0003, $7000, $A82A;
  244.  
  245. { Displaying Results }
  246.  
  247. FUNCTION
  248. OSADisplay(scriptingComponent        : ComponentInstance;
  249.            scriptValueID            : OSAID;
  250.            desiredType                : DescType;
  251.            modeFlags                : LONGINT;
  252.            VAR resultingText        : AEDesc)
  253.     : OSAError;
  254.     INLINE $2F3C, $0010, $0004, $7000, $A82A;
  255.  
  256. { Getting Error Information }
  257.  
  258. FUNCTION
  259. OSAScriptError(scriptingComponent                : ComponentInstance;
  260.                selector                            : OSType;
  261.                desiredType                        : DescType;
  262.                VAR resultingErrorDescription    : AEDesc)
  263.     : OSAError;
  264.     INLINE $2F3C, $000C, $0005, $7000, $A82A;
  265.  
  266. CONST    { OSAScriptError selectors: }
  267.     kOSAErrorNumber                = keyErrorNumber;
  268.     kOSAErrorMessage            = keyErrorString;
  269.     kOSAErrorBriefMessage        = 'errb';
  270.     kOSAErrorApp                = 'erap';
  271.     kOSAErrorPartialResult        = 'ptlr';
  272.     kOSAErrorOffendingObject    = 'erob';
  273.     kOSAErrorExpectedType        = 'errt';
  274.     kOSAErrorRange                = 'erng';
  275.  
  276.         { text ranges: }
  277.     typeOSAErrorRange            = 'erng';
  278.     keyOSASourceStart            = 'srcs';
  279.     keyOSASourceEnd                = 'srce';
  280.  
  281. { Disposing Script IDs }
  282.  
  283. FUNCTION
  284. OSADispose(scriptingComponent    : ComponentInstance;
  285.            scriptID                : OSAID)
  286.     : OSAError;
  287.     INLINE $2F3C, $0004, $0006, $7000, $A82A;
  288.  
  289. { Getting and Setting Script Information }
  290.  
  291. FUNCTION
  292. OSASetScriptInfo(scriptingComponent    : ComponentInstance;
  293.                  scriptID            : OSAID;
  294.                  selector            : OSType;
  295.                  value                : LONGINT)
  296.     : OSAError;
  297.     INLINE $2F3C, $000C, $0007, $7000, $A82A;
  298.  
  299. FUNCTION
  300. OSAGetScriptInfo(scriptingComponent    : ComponentInstance;
  301.                  scriptID            : OSAID;
  302.                  selector            : OSType;
  303.                  VAR result            : LONGINT)
  304.     : OSAError;
  305.     INLINE $2F3C, $000C, $0008, $7000, $A82A;
  306.  
  307. CONST    { selectors }
  308.     kOSAScriptIsModified            = 'modi';
  309.     kOSAScriptIsTypeCompiledScript    = 'cscr';
  310.     kOSAScriptIsTypeScriptValue        = 'valu';
  311.     kOSAScriptIsTypeScriptContext    = 'cntx';
  312.     kOSAScriptBestType                = 'best';
  313.     kOSACanGetSource                = 'gsrc';
  314.  
  315. { Manipulating the ActiveProc }
  316.  
  317. TYPE
  318.     OSAActiveProcPtr = ProcPtr;
  319.  
  320. FUNCTION
  321. OSASetActiveProc(scriptingComponent    : ComponentInstance;
  322.                  activeProc            : OSAActiveProcPtr;
  323.                  refCon                : LONGINT)
  324.     : OSAError;
  325.     INLINE $2F3C, $0008, $0009, $7000, $A82A;
  326.  
  327. FUNCTION
  328. OSAGetActiveProc(scriptingComponent    : ComponentInstance;
  329.                  VAR activeProc        : OSAActiveProcPtr;
  330.                  VAR refCon            : LONGINT)
  331.     : OSAError;
  332.     INLINE $2F3C, $0008, $000A, $7000, $A82A;
  333.  
  334. {
  335. ////////////////////////////////////////////////////////////////////////////////
  336. // OSA Optional Compiling Interface
  337. ////////////////////////////////////////////////////////////////////////////////
  338. // Scripting components that support the Compiling interface have the 
  339. // kOSASupportsCompiling bit set in it's ComponentDescription.
  340. ////////////////////////////////////////////////////////////////////////////////
  341. }
  342.  
  343. FUNCTION
  344. OSAScriptingComponentName(
  345.             scriptingComponent                    : ComponentInstance;
  346.             VAR resultingScriptingComponentName    : AEDesc)
  347.     : OSAError;
  348.     INLINE $2F3C, $0004, $0102, $7000, $A82A;
  349.  
  350. FUNCTION
  351. OSACompile(scriptingComponent                : ComponentInstance;
  352.            sourceData                        : AEDesc;
  353.            modeFlags                        : LONGINT;
  354.            VAR previousAndResultingScriptID    : OSAID)
  355.     : OSAError;
  356.     INLINE $2F3C, $000C, $0103, $7000, $A82A;
  357.  
  358. FUNCTION
  359. OSACopyID(scriptingComponent    : ComponentInstance;
  360.           fromID                : OSAID;
  361.           VAR toID                : OSAID)
  362.     : OSAError;
  363.     INLINE $2F3C, $0008, $0104, $7000, $A82A;
  364.  
  365. {
  366. ////////////////////////////////////////////////////////////////////////////////
  367. // OSA Optional GetSource Interface
  368. ////////////////////////////////////////////////////////////////////////////////
  369. // Scripting components that support the GetSource interface have the 
  370. // kOSASupportsGetSource bit set in it's ComponentDescription.
  371. ////////////////////////////////////////////////////////////////////////////////
  372. }
  373.  
  374. FUNCTION
  375. OSAGetSource(scriptingComponent            : ComponentInstance;
  376.              scriptID                    : OSAID;
  377.              desiredType                : DescType;
  378.              VAR resultingSourceData    : AEDesc)
  379.     : OSAError;
  380.     INLINE $2F3C, $000C, $0201, $7000, $A82A;
  381.  
  382. {
  383. ////////////////////////////////////////////////////////////////////////////////
  384. // OSA Optional AECoercion Interface
  385. ////////////////////////////////////////////////////////////////////////////////
  386. // Scripting components that support the AECoercion interface have the 
  387. // kOSASupportsGetSource bit set in it's ComponentDescription.
  388. ////////////////////////////////////////////////////////////////////////////////
  389. }
  390.  
  391. FUNCTION
  392. OSACoerceFromDesc(scriptingComponent            : ComponentInstance;
  393.                   scriptData                    : AEDesc;
  394.                   modeFlags                        : LONGINT;
  395.                   VAR resultingScriptID            : OSAID)
  396.     : OSAError;
  397.     INLINE $2F3C, $000C, $0301, $7000, $A82A;
  398.  
  399. FUNCTION
  400. OSACoerceToDesc(scriptingComponent    : ComponentInstance;
  401.                 scriptID            : OSAID;
  402.                 desiredType            : DescType;
  403.                 modeFlags            : LONGINT;
  404.                 VAR result            : AEDesc)
  405.     : OSAError;
  406.     INLINE $2F3C, $0010, $0302, $7000, $A82A;
  407.  
  408. {
  409. ////////////////////////////////////////////////////////////////////////////////
  410. // OSA Optional AESending Interface
  411. ////////////////////////////////////////////////////////////////////////////////
  412. // Scripting components that support the AESending interface have the 
  413. // kOSASupportsAESending bit set in it's ComponentDescription.
  414. ////////////////////////////////////////////////////////////////////////////////
  415. }
  416.  
  417. TYPE 
  418.     AESendProcPtr = ProcPtr;
  419.     AECreateAppleEventProcPtr = ProcPtr;
  420.     
  421. {  The first two proc pointers have the following interfaces
  422.    taken from AppleEvents.p 
  423.    
  424.     FUNCTION MyAECreateProc(theAEEventClass: AEEventClass;
  425.                             theAEEventID: AEEventID;
  426.                             target: AEAddressDesc;
  427.                             returnID: INTEGER;
  428.                             transactionID: LONGINT;
  429.                             VAR result: AppleEvent): OSErr;
  430.     
  431.     FUNCTION MyAESendProc(theAppleEvent: AppleEvent;
  432.                           VAR reply: AppleEvent;
  433.                           sendMode: AESendMode;
  434.                           sendPriority: AESendPriority;
  435.                           timeOutInTicks: LONGINT;
  436.                           idleProc: IdleProcPtr;
  437.                           filterProc: EventFilterProcPtr): OSErr;
  438.  
  439.     FUNCTION MyActiveProc(): OSErr;
  440.  
  441. }
  442.  
  443. FUNCTION
  444. OSASetSendProc(scriptingComponent    : ComponentInstance;
  445.                sendProc                : AESendProcPtr;
  446.                refCon                : LONGINT)
  447.     : OSAError;
  448.     INLINE $2F3C, $0008, $0401, $7000, $A82A;
  449.  
  450. FUNCTION
  451. OSAGetSendProc(scriptingComponent    : ComponentInstance;
  452.                VAR sendProc            : AESendProcPtr;
  453.                VAR refCon            : LONGINT)
  454.     : OSAError;
  455.     INLINE $2F3C, $0008, $0402, $7000, $A82A;
  456.  
  457. FUNCTION
  458. OSASetCreateProc(scriptingComponent    : ComponentInstance;
  459.                  createProc            : AECreateAppleEventProcPtr;
  460.                  refCon                : LONGINT)
  461.     : OSAError;
  462.     INLINE $2F3C, $0008, $0403, $7000, $A82A;
  463.  
  464. FUNCTION
  465. OSAGetCreateProc(scriptingComponent    : ComponentInstance;
  466.                  VAR createProc        : AECreateAppleEventProcPtr;
  467.                  VAR refCon            : LONGINT)
  468.     : OSAError;
  469.     INLINE $2F3C, $0008, $0404, $7000, $A82A;
  470.  
  471. FUNCTION
  472. OSASetDefaultTarget(scriptingComponent    : ComponentInstance;
  473.                      target                : AEAddressDesc)
  474.     : OSAError;
  475.     INLINE $2F3C, $0004, $0405, $7000, $A82A;
  476.  
  477. {
  478. ////////////////////////////////////////////////////////////////////////////////
  479. // OSA Optional Recording Interface
  480. ////////////////////////////////////////////////////////////////////////////////
  481. // Scripting components that support the Recording interface have the 
  482. // kOSASupportsRecording bit set in it's ComponentDescription.
  483. ////////////////////////////////////////////////////////////////////////////////
  484. }
  485.  
  486. FUNCTION
  487. OSAStartRecording(scriptingComponent            : ComponentInstance;
  488.                   VAR compiledScriptToModifyID    : OSAID)
  489.     : OSAError;
  490.     INLINE $2F3C, $0004, $0501, $7000, $A82A;
  491.  
  492. FUNCTION
  493. OSAStopRecording(scriptingComponent        : ComponentInstance;
  494.                  compiledScriptID        : OSAID)
  495.     : OSAError;
  496.     INLINE $2F3C, $0004, $0502, $7000, $A82A;
  497.  
  498. {
  499. ////////////////////////////////////////////////////////////////////////////////
  500. // OSA Optional Convenience Interface
  501. ////////////////////////////////////////////////////////////////////////////////
  502. // Scripting components that support the Convenience interface have the 
  503. // kOSASupportsConvenience bit set in it's ComponentDescription.
  504. ////////////////////////////////////////////////////////////////////////////////
  505. }
  506.  
  507. FUNCTION 
  508. OSALoadExecute(scriptingComponent            : ComponentInstance;
  509.                scriptData                    : AEDesc;
  510.                contextID                    : OSAID;
  511.                modeFlags                    : LONGINT;
  512.                VAR resultingScriptValueID    : OSAID)
  513.     : OSAError;
  514.     INLINE $2F3C, $0010, $0601, $7000, $A82A;
  515.  
  516. FUNCTION 
  517. OSACompileExecute(scriptingComponent            : ComponentInstance;
  518.                   sourceData                    : AEDesc;
  519.                   contextID                        : OSAID;
  520.                   modeFlags                        : LONGINT;
  521.                   VAR resultingScriptValueID    : OSAID)
  522.     : OSAError;
  523.     INLINE $2F3C, $0010, $0602, $7000, $A82A;
  524.  
  525. FUNCTION 
  526. OSADoScript(scriptingComponent            : ComponentInstance;
  527.             sourceData                    : AEDesc;
  528.             contextID                    : OSAID;
  529.             desiredType                    : DescType;
  530.             modeFlags                    : LONGINT;
  531.             VAR resultingText            : AEDesc)
  532.     : OSAError;
  533.     INLINE $2F3C, $0014, $0603, $7000, $A82A;
  534.  
  535. {
  536. ////////////////////////////////////////////////////////////////////////////////
  537. // OSA Optional Dialects Interface
  538. ////////////////////////////////////////////////////////////////////////////////
  539. // Scripting components that support the Dialects interface have the 
  540. // kOSASupportsDialects bit set in it's ComponentDescription.
  541. ////////////////////////////////////////////////////////////////////////////////
  542. }
  543.  
  544. FUNCTION 
  545. OSASetCurrentDialect(scriptingComponent    : ComponentInstance;
  546.                      dialectCode        : INTEGER)
  547.     : OSAError;
  548.     INLINE $2F3C, $0002, $0701, $7000, $A82A;
  549.  
  550. FUNCTION 
  551. OSAGetCurrentDialect(scriptingComponent            : ComponentInstance;
  552.                      VAR resultingDialectCode    : INTEGER)
  553.     : OSAError;
  554.     INLINE $2F3C, $0004, $0702, $7000, $A82A;
  555.  
  556. FUNCTION 
  557. OSAAvailableDialects(scriptingComponent                : ComponentInstance;
  558.                      VAR resultingDialectInfoList    : AEDesc)
  559.     : OSAError;
  560.     INLINE $2F3C, $0004, $0703, $7000, $A82A;
  561.     { *** This is obsolete. }
  562.     { *** Use OSAAvailableDialectCodeList and OSAGetDialectInfo. }
  563.  
  564. FUNCTION 
  565. OSAGetDialectInfo(scriptingComponent            : ComponentInstance;
  566.                   dialectCode                    : INTEGER;
  567.                   selector                        : OSType;
  568.                   VAR resultingDialectInfo        : AEDesc)
  569.     : OSAError;
  570.     INLINE $2F3C, $000A, $0704, $7000, $A82A;
  571.  
  572. FUNCTION 
  573. OSAAvailableDialectCodeList(scriptingComponent            : ComponentInstance;
  574.                              resultingDialectCodeList    : AEDesc)
  575.     : OSAError;
  576.     INLINE $2F3C, $0004, $0705, $7000, $A82A;
  577.  
  578. CONST
  579.     typeOSADialectInfo                    = 'difo';
  580.     keyOSADialectName                    = 'dnam';
  581.     keyOSADialectCode                    = 'dcod';
  582.     keyOSADialectLangCode                = 'dlcd';
  583.     keyOSADialectScriptCode                = 'dscd';
  584.  
  585. {
  586. ////////////////////////////////////////////////////////////////////////////////
  587. // OSA Optional Event Handling Interface
  588. ////////////////////////////////////////////////////////////////////////////////
  589. // Scripting components that support the Event Handling interface have the 
  590. // kOSASupportsEventHandling bit set in it's ComponentDescription.
  591. ////////////////////////////////////////////////////////////////////////////////
  592. }
  593.  
  594. TYPE
  595.     AEHandlerProcPtr            = EventHandlerProcPtr;
  596.  
  597. FUNCTION
  598. OSASetResumeDispatchProc(scriptingComponent    : ComponentInstance;
  599.                          resumeDispatchProc    : AEHandlerProcPtr;
  600.                          refCon                : LONGINT)
  601.     : OSAError;
  602.     INLINE $2F3C, $0008, $0801, $7000, $A82A;
  603.  
  604. CONST
  605.     { ResumeDispatchProc constants }
  606.     kOSAUseStandardDispatch        = kAEUseStandardDispatch;
  607.     kOSANoDispatch                = kAENoDispatch;
  608.     { OSASetResumeDispatchProc refCon constants }
  609.     kOSADontUsePhac                = $0001;
  610.  
  611. FUNCTION
  612. OSAGetResumeDispatchProc(scriptingComponent        : ComponentInstance;
  613.                          VAR resumeDispatchProc    : AEHandlerProcPtr;
  614.                          VAR refCon                : LONGINT)
  615.     : OSAError;
  616.     INLINE $2F3C, $0008, $0802, $7000, $A82A;
  617.  
  618. FUNCTION
  619. OSAExecuteEvent(scriptingComponent            : ComponentInstance;
  620.                 theAppleEvent                : AppleEvent;
  621.                 contextID                    : OSAID;
  622.                 modeFlags                    : LONGINT;
  623.                 VAR resultingScriptValueID    : OSAID)
  624.     : OSAError;
  625.     INLINE $2F3C, $0010, $0803, $7000, $A82A;
  626.  
  627. FUNCTION
  628. OSADoEvent(scriptingComponent    : ComponentInstance;
  629.            theAppleEvent        : AppleEvent;
  630.            contextID            : OSAID;
  631.            modeFlags            : LONGINT;
  632.            VAR reply            : AppleEvent)
  633.     : OSAError;
  634.     INLINE $2F3C, $0010, $0804, $7000, $A82A;
  635.  
  636. FUNCTION
  637. OSAMakeContext(scriptingComponent        : ComponentInstance;
  638.                contextName                : AEDesc;
  639.                parentContext            : OSAID;
  640.                VAR resultingContextID    : OSAID)
  641.     : OSAError;
  642.     INLINE $2F3C, $000C, $0805, $7000, $A82A;
  643.  
  644. {$ENDC}    { UsingOSA }
  645.  
  646. {$IFC NOT UsingIncludes}
  647.     END.
  648. {$ENDC}
  649.